Other Constants

The following constants are available globally.

  • An NSNumber object containing a floating-point number that specifies the width and height (measured in points) at which the map displays each raster image tile when the map’s zoom level is an integer. The raster source scales its images up or down when the map’s zoom level falls between two integers.

    The default value for this option is 512. Version 4 of the Mapbox Raster Tiles API requires a value of 256, as do many third-party tile servers, so consult your provider’s documentation for the correct value.

    This option is only applicable to MGLRasterSource objects; it is ignored when initializing MGLVectorSource objects.

    Declaration

    Objective-C

    extern const MGLTileSourceOption _Nonnull MGLTileSourceOptionTileSize

    Swift

    static let tileSize: MGLTileSourceOption
  • A version number identifying the default version of the suite of default styles provided by Mapbox. This version number may be passed into one of the “StyleURLWithVersion” class methods of MGLStyle.

    The value of this constant generally corresponds to the latest released version as of the date on which this SDK was published. You can use this constant to ascertain the style used by MGLMapView and MGLTilePyramidOfflineRegion when no style URL is specified. Consult the Mapbox Styles API documentation for the most up-to-date style versioning information.

    Warning

    The value of this constant may change in a future release of the SDK. If you use any feature that depends on a specific aspect of a default style – for instance, the minimum zoom level that includes roads – you may use the current value of this constant or the underlying style URL, but do not use the constant itself. Such details may change significantly from version to version.

    Declaration

    Objective-C

    static const NSInteger MGLStyleDefaultVersion = 9

    Swift

    let MGLStyleDefaultVersion: Int
  • Indicates an error occurred in the Mapbox SDK.

    Declaration

    Objective-C

    extern const NSErrorDomain _Nonnull MGLErrorDomain

    Swift

    let MGLErrorDomain: String